<template>
  <div>
    <h1>Vue2 + Vite + ECharts</h1>
    <ChartDemo />
    <button @click="inc">count is {{ count }}</button>
  </div>
</template>

<script>
import { mapState, mapMutations } from 'vuex'
import ChartDemo from '../components/ChartDemo.vue'

export default {
  components: { ChartDemo },
  computed: mapState(['count']),
  methods: {
    ...mapMutations(['increment']),
    inc() {  // 自定义一个方法调用 Vuex mutation
      this.increment()
    }
  },
  created() {
    console.log('Home mounted!')
  }
}
</script>
